<?php
	/**
	 * Value object representation of a system user.
	 */
	class UserVO {
		
		var $_explicitType="vo.UserVO";
		
		/** The unique ID of the user. */
		var $userUID;
		
		/** The first name of the user. */
		var $firstName;
		
		/** The last name of the user */
		var $lastName;
		
		/** The email address of the user. */
		var $email;
		
		/** The phone number of the user. */
		var $phoneNumber;
		
		/** True, if the user is a system administrator, otherwise false. */
		var $isAdministrator;
		
		/** A short biographic description of the user. */
		var $description;
		
		/** The gender of the user. */
		var $gender;
		
		/** The birth date of the user. */
		var $dateOfBirth;
		
		/** The country/city where the user is from. */
		var $location;
		
		/** The job title of the user. */
		var $occupation;
		
		/** The company the user works for. */
		var $institution;
		
		/** Creates a new instance of a UserVO. */
		public function UserVO() {}
		
		/**
		 * Maps a database record to a UserVO.
		 * @param $row The record to map to a UserVO.
		 * @return A new mapped instance of a UserVO.
		 */
		public static function mapObject($row) {
			
			$vo = new UserVO();
			
			$vo->userUID 			= $row["userUID"];
			$vo->firstName 			= $row["firstName"];
			$vo->lastName 			= $row["lastName"];
			$vo->email 				= $row["email"];
			$vo->phoneNumber 		= $row["phoneNumber"];
			$vo->isAdministrator 	= ($row["isAdministrator"] == 1? true:false);
			$vo->description 		= $row["description"];
			$vo->gender 			= $row["gender"];
			$vo->dateOfBirth 		= $row["dateOfBirth"];
			$vo->location 			= $row["location"];
			$vo->occupation 		= $row["occupation"];
			$vo->institution 		= $row["institution"];
			
			return $vo;
		}
	}
?>